# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=libdex
pkgver=0.6.0
pkgrel=0
pkgdesc="Future-based programming for GLib-based applications"
url="https://gitlab.gnome.org/GNOME/libdex"
# ppc64le: fails tests
arch="all !ppc64le"
license="LGPL-2.1-or-later AND BSD-3-Clause"
makedepends="
	glib-dev
	gobject-introspection-dev
	libucontext-dev
	meson
	vala
	"
subpackages="$pkgname-dev"
source="https://download.gnome.org/sources/libdex/${pkgver%.*}/libdex-$pkgver.tar.xz
	ucontext.patch
	"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dtests="$(want_check && echo true || echo false)" \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
b0cd2cfb6fa21bc1c20cab2ad8676392aefcdf22a0cafb93d85da92aea53f3ac0536c37bbe716e06fe8a71c8535b01d7dea20ddf574147a1573022dc663d7580  libdex-0.6.0.tar.xz
c64dad8be4999efd66bdc82c919023306a96d437b99d18d948fe61b8d48686bedbe8260f6230e834bd2770c40a83ca9f40e0a04f4936f5097c9c791b984df8ec  ucontext.patch
"
